import request from '../utils/request'
import type { Album, PUserCollection, Wallpaper } from '@/api/types'
const baseUrl = '/wallpaper'

/**
 * 用户发布壁纸
 * @param {Object} params
 */
export function apiPostingWallpaper(params: Wallpaper) {
  return request({
    url: baseUrl + '/posting/wallpaper',
    method: 'POST',
    data: params,
  })
}

/**
 * 用户发布专辑
 * @param {Object} params
 */
export function apiPostingAlbum(params: Album) {
  return request({
    url: baseUrl + '/posting/album',
    method: 'POST',
    data: params,
  })
}

/**
 * 用户增加个人收藏
 */
export function apiUserAddCollection(params: PUserCollection) {
  return request({
    url: baseUrl + '/collection',
    method: 'POST',
    data: params,
  })
}

/**
 * 用户获取个人收藏
 */
export function apiGetUserCollection(params: PUserCollection) {
  return request({
    url: baseUrl + '/collection/list',
    method: 'GET',
    data: params,
  })
}

/**
 * 获取分类名称列表
 */
export function apiGetCategoryNames(type: String) {
  return request({
    url: baseUrl + `/classify/names/${type}`,
    method: 'GET',
  })
}
